<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="nc.vo.ebvp.constant.IModuleCodeConstant"%>
<%@ page import="nc.bs.ecpubapp.tools.ECVersionPara"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page import="nc.vo.ebvp.logindex.pojo.Constant"%>
<%@ page import="nc.vo.sm.UserVO"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/WEB-INF/lang-support.tld" prefix="lang-support"%>

<html>
<head>
<%
		String basepath = request.getContextPath();
		Boolean isValidSupForZhaobiaoBid = (Boolean)request.getSession().getAttribute(Constant.IS_VALID_SUPPLIER_FOR_ZHAOBIAO_BID);

		String url = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
		Boolean isEcSupp = (Boolean)request.getSession().getAttribute(Constant.IS_EC_SUPP);
		String cssSignal = "";
		String textfieldReadonlyAttr = "";
		String disabledSignal = "";
		String suppName = "";
		boolean isReadOnly = false;
		Object obj = session.getAttribute("suppName");
		if (obj != null) {
			suppName = obj.toString();
		}
		String strSysId = (String)request.getSession().getAttribute("run_sys_id");
		boolean bIsScmSys = false;
		if("SCM".equals(strSysId)){
			bIsScmSys = true;
		}
		boolean bIsEsbSys = false;
		if("ESB".equals(strSysId)){
			bIsEsbSys = true;
		}
		String header_logo = (String)request.getSession().getAttribute("header_logo");
		java.util.Map<String,Boolean> mapModulesStatus = (java.util.Map<String,Boolean>)session.getAttribute(IModuleCodeConstant.MODULE_SESSION_ID);
		boolean bModuleSRM = mapModulesStatus.get(IModuleCodeConstant.MODULE_SRM).booleanValue();
		boolean bModuleSCM_PU = mapModulesStatus.get(IModuleCodeConstant.MODULE_SCM_PU).booleanValue();
		boolean bModuleSCM_CT = mapModulesStatus.get(IModuleCodeConstant.MODULE_SCM_CT).booleanValue();
		boolean bModuleSCM_IC = mapModulesStatus.get(IModuleCodeConstant.MODULE_SCM_IC).booleanValue();
		boolean bModuleSCM_IC_SYS = mapModulesStatus.get(IModuleCodeConstant.MODULE_SCM_IC).booleanValue() && bIsScmSys;
		boolean bModuleARAP = mapModulesStatus.get(IModuleCodeConstant.MODULE_ARAP).booleanValue();
		boolean bModuleEBP = mapModulesStatus.get(IModuleCodeConstant.MODULE_EBP).booleanValue();
		boolean bModuleSCM_IC_EBP_SYS = bModuleSCM_IC && bModuleEBP && bIsScmSys;
		boolean bModuleEBVSC = mapModulesStatus.get(IModuleCodeConstant.MODULE_EBVSC).booleanValue();
		boolean bModuleEBVSC_SYS = mapModulesStatus.get(IModuleCodeConstant.MODULE_EBVSC).booleanValue() && bIsScmSys;
		boolean bModuleEBPOrSRM = bModuleEBP|| bModuleSRM;
		String strHelpHtml = (String)request.getParameter(Constant.HELP_HTML);
		if(null == strHelpHtml){
			strHelpHtml = (String)request.getAttribute(Constant.HELP_HTML);
		}
		String strSelLan = (String)request.getSession().getAttribute("sel_lan");
	%>

<c:if test="${IS_READ_ONLY != null}">
	<%
			cssSignal = "readonly_";
			textfieldReadonlyAttr = "readonly";
			disabledSignal = "disabled";
			isReadOnly = true;
		%>
</c:if>

<script type="text/javascript">
		var isValidSupForZhaobiaoBid = <%=isValidSupForZhaobiaoBid%>;
		var basePath = "<%=url%>/";
		var bModuleSRM = <%=bModuleSRM%>;
		var bModuleSCM_PU = <%=bModuleSCM_PU%>;
		var bModuleSCM_CT = <%=bModuleSCM_CT%>;
		var bModuleSCM_IC = <%=bModuleSCM_IC%>;
		var bModuleARAP = <%=bModuleARAP%>;
		var bModuleEBP = <%=bModuleEBP%>;
		var bModuleEBVSC = <%=bModuleEBVSC%>;
		var bModuleEBVSC_SYS = <%=bModuleEBVSC_SYS%>;
		var bModuleARAPOrSCM_PU = <%=(bModuleARAP || bModuleSCM_PU)%>;
		var bModuleARAPOrSCM_PU_IC = <%=(bModuleARAP || bModuleSCM_PU || bModuleSCM_IC)%>;
		var bModuleEBPOrSCM_PU = <%=(bModuleEBP || bModuleSCM_PU)%>;
		var bModuleEBPOrSCM_CT = <%=(bModuleEBP || bModuleSCM_CT)%>;
		var bModuleEBPOrSCM_PU_CT = <%=(bModuleEBP || bModuleSCM_PU || bModuleSCM_CT)%>;
		var bModuleEBPOrSRM = <%=(bModuleEBP || bModuleSRM)%>;
		var bModuleEBVSCOrSCM_PU = <%=(bModuleEBVSC || bModuleSCM_PU)%>;
		var bModuleSCM_IC_SYS = <%=bModuleSCM_IC_SYS%>;
		var bModuleSCM_IC_EBP_SYS = <%=bModuleSCM_IC_EBP_SYS%>;
		var strSelLan = "${sel_lan}";
		var bIsEsbSys = <%=bIsEsbSys%>;
		var bStdVersion = <%=ECVersionPara.isStdVersion()%>;
		var bGh2Version = <%=ECVersionPara.isGHVersion2()%>;		
	</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><lang-support:wp resid="ec22180_0" key="0ec22180-100012" />
</title>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/base/base.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/frame.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/myframe.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/header.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/footer.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/register.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/myregister.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/picker.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/validator.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/newcalendar/calendar.css" />

<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/schedulemain.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/base/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	(function($) {
		$.ajax({
			type: "POST",
	        url:"/ebvp/schedulecoll/langtrconller/langtr",
	        async: false, data:"nameclass=nc.bs.ebvp.schedulecoQuery.RegisterMutiLanImpl",
	        success:function(msg) {
	        	map = msg;
	       }
		});
	})($);
	</script>

<script type="text/javascript"
	src="/web/component/webpub/core/seajs2/dist/sea-debug.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/component/ebvp/core/config.js"></script>

<script type="text/javascript"
	src="<%=basepath%>/commonres/tools/util.js"></script>
<!-- UI Plugin -->
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/tipinside/src/css/tipinside.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/tipinside/src/js/UI.TipInside.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/finish_steps/src/css/finish_steps.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/finish_steps/src/js/UI.FinishSteps.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/navigator/src/css/navigator.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/navigator/src/js/UI.Navigator.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/drop_menu/src/css/drop_menu.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/drop_menu/src/js/UI.DropMenu.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/column_menu/src/css/column_men.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/column_menu/src/js/UI.ColumnMenu.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/operation_flow/src/css/operation_flow.css" />
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/operation_flow/src/js/UI.OperationFlow.js"></script>

<link href="<%=basepath%>/commonres/common/frame/src/css/InfoChange.css"
	rel="stylesheet" type="text/css" />
<link href="<%=basepath%>/commonres/common/frame/src/css/JqueryTab.css"
	rel="stylesheet" type="text/css" />
<link href="<%=basepath%>/commonres/common/frame/src/css/tab.css"
	rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="<%=basepath%>/commonres/common/frame/src/css/subpage.css" />

<script language="javascript" type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/JqueryTab.js"></script>
<script language="javascript" type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/ControlPage.js"></script>
<script language="javascript" type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/InfoChange.js"></script>
<%-- <script language="javascript" type="text/javascript"
			src="<%=basepath%>/commonres/common/frame/src/js/include.js"></script> --%>
<script
	src="<%=url%>/web/component/webpub/tools/jquery.validation/jquery.validate.js"
	type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"
	src="<%=url%>/web/component/webpub/tools/jquery.validation/additional-methods.js"
	charset="utf-8"></script>

<script type="text/javascript"
	src="<%=basepath%>/commonres/base/common.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/messages_cn.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/customized_validation.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/common_validate.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/selfservice.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/top_menu.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/selfservice_maintain.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/selfserv_reg_common.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/common_ectype.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/common_qa.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/common_doctype.js"></script>
<script type="text/javascript"
	src="<%=basepath%>/commonres/common/frame/src/js/numScale.js"></script>
<script type="text/javascript">
	    var ebvp_context="<%=basepath%>";
	    var browsepage = "<%=isReadOnly%>";
	    var isEcSupp = "<%=isEcSupp%>";
	    var randomPk = Math.floor(Math.random()*10000000000000000000);

	$(function() {
		$("#enterpriceInfoMaintain").parents("ul").find(".current")
				.removeClass("current");
		$("#enterpriceInfoMaintain").addClass("current");
	});


	function addFileRow(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath, id){
		//这里处理上传Logo;如果id=UPLOAD_LOGO
		if(id=="UPLOAD_LOGO"){
			if(replyFilePath != null){
    			//文件大小不能大于50KB
    			var error = 0;
    			$("#complateBaseInfo").find("#logoSizeError").remove();
    			if(replyFileSize > 51200){
    				var div = $("<div></div>").attr("id", "logoSizeError").text(getLanMsgs("0ec22180-100241")).attr("style", "color:red; font-size:12px");
    				div.insertAfter($("#logoTip"));
    				error = error + 1;
    			}
    			//文件没有扩展名
    			$("#complateBaseInfo").find("#logoExtError").remove();
    			if(replyFileName != null && replyFileName !="" ){
    				if(replyFileName.indexOf(".") != -1){
    					var fileExt = replyFileName.substring(replyFileName.indexOf(".")+1);
    					if(fileExt != "png" && fileExt != "jpg" && fileExt != "bmp" && fileExt !="gif" ){
    						var div = $("<div></div>").attr("id", "logoExtError").text(getLanMsgs("0ec22180-100242")).attr("style", "color:red; font-size:12px");
    						div.insertAfter($("#logoTip"));
    						error = error + 1;
    					}
    				}else {                                 
    					var div = $("<div></div>").attr("id", "logoExtError").text(getLanMsgs("0ec22180-100242")).attr("style", "color:red; font-size:12px");
    					div.insertAfter($("#logoTip"));
    					error = error + 1;
    				}
    			}
    			if(error > 0){
    				return ;
    			}else{
    				var pk_file = replyFilePath.split("#")[0];
	    			$("#pk_file").val(pk_file);
    				//设置尺寸，按照116*38的比例设置logo的尺寸
    				var thelogo = $("<img></img>")
    				.attr("src", ebvp_context + "/register/getLogoImage?pk_file="+pk_file)
    				.attr("height",38).attr("width", 116);
    				$("#logo").empty().append(thelogo).attr("align", "center");
	    		}
			}
			return;
		}
		//上传资质和资料类型附件
		var qaAttachdiv = $("#"+id).parents(".idItems").find(".attachment");				
		var newAttachFileName = replyFileName;   
		if(replyFilePath != null && replyFileName != null && replyFilePath.length>replyFileName.length){
			if($("#"+id).parents(".idItems").find("[name='filepath']").length != 0){
				$($("#"+id).parents(".idItems").find("[name='filepath']")[0])
    			.val( replyFilePath.substring(0, replyFilePath.indexOf(replyFileName)-1) );
			}else {
				$($("#"+id).parents(".idItems").find("[name='docfilepath']")[0])
    			.val( replyFilePath.substring(0, replyFilePath.indexOf(replyFileName)-1) );
			}
		}
		var attList = $( '<div></div>' ).addClass("attachment_list").addClass("bdtop");
		var attchFileName = $( '<div></div>' ).addClass("attach_filename").html(newAttachFileName +"("+ replyFileSize  +"B)" );
		var inputNameObj = $("<input></input>").attr("name","fileAlias").attr("type","hidden").val(replyFilePath);
		var fullnameObj = $("<div></div>").append(inputNameObj);
		attList.append(attchFileName).append(fullnameObj);  //名称

		var floatRight =$("<div></div>").addClass("float_right");
	    var del = $("<a></a>").addClass("btn_delete_attach attach_delete").attr("tag", "DELATTACH_"+id.substring(id.indexOf("_")+1));
	    floatRight.append(del);         //删除
	    
		qaAttachdiv.append(attList).append(floatRight);
       
       return false;
	}

	$(document).ready(function(){
		if(bGh2Version){
			$.commonValidator_registerForm_Gh2("#selfserviceMaintainForm");
		}else {
			$.commonValidator_registerForm("#selfserviceMaintainForm");
		}
	});
</script>

<lang-support:langres resid="ec22400_0" />
</head>
<body>
	<!-- Page Header -->
	<div class="header">
		<div class="header_bg_left">
			<div class="header_bg_right">
				<div class="float_center doc_width">
					<div class="header_content doc_width">
						<div id="signedInNavigatorBar" class="header_navigator"></div>
						<div class="<%=header_logo%>"></div>
						<div class="header_functions">
							<div class="signon">
								<span class="icon"></span> <span id="userName"><%=suppName%></span>
							</div>
							<a href="<%=request.getContextPath()%>/login/loginOut"
								class="register"> <span class="icon"></span> <span> <lang-support:wp
										resid="ec22180_0" key="0ec22180-100156" />
							</span> </a> <a class="service" id="selfService"> <span class="icon"></span>
								<span> <lang-support:wp resid="ec22180_0"
										key="0ec22180-100151" />
							</span> <span class="arrow"></span> </a>
							<%if(null != strHelpHtml && !"".equals(strHelpHtml.trim())){%>
							<a href="javascript:void(null);"
								onclick="doHelp('<%=request.getContextPath()%>/help/<%=strSelLan%>/html/<%=strHelpHtml%>');"
								class="register"> <span resid="0ec22400-000111">帮助</span> </a>
							<%}%>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- Document Content -->
	<div class="float_center doc_width">
		<div class="doc_content_shadow">
			<div class="doc_content">
				<div id="columnLeft" class="frame_column_left"></div>
				<div class="frame_right">
					<div class="location_bar">
						<a href="<%=basepath%>/infopub/pubmain"> <lang-support:wp
								resid="ec22400_0" key="0ec22400-000012" />
						</a> <a> <lang-support:wp resid="ec22180_0" key="0ec22180-100151" />
						</a> <span> <lang-support:wp resid="ec22180_0"
								key="0ec22180-100247" />
						</span>
					</div>
					<div id="complateInfo" class="float_left w_100ps">
						<div class="clear"></div>
						<div id="complateForm" class="complate_form_my">
							<form name="selfserviceMaintainForm" id="selfserviceMaintainForm"
								method="post">
								<div id="tab" class="tabSty">
									<ul id="tabMenu">
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA boldFont selected"><lang-support:wp
												resid="ec22180_0" key="0ec22180-100158" /></li>
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA"><lang-support:wp resid="ec22180_0"
												key="0ec22180-100082" /></li>
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA"><lang-support:wp resid="ec22180_0"
												key="0ec22180-100159" /></li>
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA"><lang-support:wp resid="ec22180_0"
												key="0ec22180-100034" /></li>
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA"><lang-support:wp resid="ec22180_0"
												key="0ec22180-100114" /></li>
										<li class="firstBaseLine" style="width: 15px"></li>
										<li class="tabA">资料</li>
									</ul>
									<div id="tabTop" class="tabTop"></div>

									<div class="clear"></div>

									<div class="clear"></div>

									<div class="tabBody">
										<div id="supBaseInfo" class="show parent">
											<jsp:include page="selfservice_maintain_tab1.jsp"></jsp:include>
										</div>
										<div id="bankAccInfo" class="parent">
											<jsp:include page="selfservice_maintain_tab2.jsp"></jsp:include>
										</div>
										<div id="prodInfo" class="parent">
											<jsp:include page="selfservice_maintain_tab3.jsp"></jsp:include>
										</div>
										<div id="qualityInfo" class="parent">
											<jsp:include page="selfservice_maintain_tab4.jsp"></jsp:include>
										</div>
										<div id="managementInfo" class="parent">
											<jsp:include page="selfservice_maintain_tab5.jsp"></jsp:include>
										</div>
										<div id="docTypeInfo" class="parent">
											<jsp:include page="selfservice_maintain_tab6.jsp"></jsp:include>
										</div>
									</div>
									<div id="tabBottom"></div>
								</div>

								<div class="form690">
									<c:if test="${ERROR_MESSAGE != null}">
										<div class="block1">
											<img
												src="<%=basepath%>/commonres/common/frame/src/img/img_error.png" />${ERROR_MESSAGE}
										</div>
									</c:if>
									<c:if test="${SUCCESS_MESSAGE != null}">
										<div class="block1">
											<img
												src="<%=basepath%>/commonres/common/frame/src/img/img_success.png" />${SUCCESS_MESSAGE}
										</div>
									</c:if>
									<%
										if (!isReadOnly) {
									%>
									<div class="block2">
										<a id="selfserviceMaintainSubmit" class="btn_orange"> <span
											class="w_80px h_25px ft_12px"> <lang-support:wp
													resid="ec22180_0" key="0ec22180-100148" />
										</span> </a>
									</div>
									<%
										}
									%>
								</div>

								<div>
									<c:if test="${vendType!= null && vendType == 6}">
										<div class="message">
											<img src="<%=basepath%>/images/account/msg.png" alt="" /> <label>
												<lang-support:wp resid="ec22180_0" key="0ec22180-100160" />
											</label>
										</div>
									</c:if>
									<c:if
										test="${ (vendType == null || vendType != 6) && (currentInfo.isReadAfterAudit==\"N\") }">
										<div class="message">
											<img src="<%=basepath%>/images/account/msg.png" alt="" /> <label>
												<lang-support:wp resid="ec22180_0" key="0ec22180-100161" />
											</label>
										</div>
									</c:if>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- Page Footer -->
	<div class="float_left w_100ps">
		<div class="footer">
			<div class="footer_bg bg_left">
				<div class="footer_bg bg_right">
				<%
					if (ECVersionPara.isStdVersion()) {
				%>
                <br/><span><lang-support:wp resid="ec22400_0" key="0ec22400-000042"/></span>
                <%
                	} 
                %>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	changeLan();
</script>
</html>